import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import './assets/css/base.css'
import './assets/fonts/iconfont.css'
import _ from 'lodash'
//导入表格
import TreeTable from 'vue-table-with-tree-grid'

// import Vue from 'vue'
import VueQuillEditor from 'vue-quill-editor'

// require styles 导入富文本编译器对应的样式
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'

Vue.use(VueQuillEditor, /* { default global options } */)


import axios from 'axios'
axios.interceptors.request.use(function (config) {
  config.headers.Authorization = sessionStorage.getItem('token') || ''
  return config;
}
);

Vue.prototype.$http = axios
//配置请求根路径
axios.defaults.baseURL = 'https://www.liulongbin.top:8888/api/private/v1/'
Vue.config.productionTip = false
Vue.filter('dateFormat',function (info) {  
  let date = new Date(info)

  let y = date.getFullYear()
  let M = (date.getMonth() + 1+'').padStart(2,'0')
  let d = (date.getDate() + '').padStart(2,'0')
  let h = (date.getHours() + '').padStart(2,'0')
  let m = (date.getMinutes() + '').padStart(2,'0')
  let s = (date.getSeconds() + '').padStart(2,'0')
  return `${y}-${M}-${d} ${h}:${m}:${s}`
})
Vue.component('tree-table', TreeTable)
//将富文本编译器，注册为全局可用的组件
Vue.use(VueQuillEditor)

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
